home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 2: CDPD 1 / Almathera Ten on Ten - Disc 2: CDPD 1.iso / pd / 176-200 / 183 / mklib / edlib / bintoint.c next >
C/C++ Source or Header  |  1995-03-13  |  354b  |  17 lines

  1. /* edlib  version 1.0 of 04/08/88 */
  2. /* this function takes a string of binary digits and returns its value */
  3. int bintoint(number)
  4. char *number;
  5. {
  6.     int value = 0;
  7.  
  8.     while ( *number )
  9.         if ( isbdigit(*number) ) {
  10.             value = (value << 1) + toint(*number++);
  11.         } else {
  12.             return(value);
  13.         }
  14.  
  15.     return(value);
  16. }
  17.